#ifndef __AI_H__
#define __AI_H__

#include "FruitSaladAi.hpp"
#include "SpecificCommunicator.hpp"
#include "SpecificApiConnector.hpp"
#include "world.hpp"
#include "Strat.hpp"

#define AI_NAME "INSAStras"

class Ai : FruitSaladAi {
public:
    World world;
    Strat strat;

    //Conditions de victoire
    unsigned int limVitamines;
    unsigned int limTurns;

    //Tour actuel
    unsigned int curTurn;

	SpecificCommunicator *communicator;
	SpecificApiConnector *api;

	// Constructor & Destructor
	Ai();
	~Ai();

	// Commons functions
	void stop();

	// User-defined functions
	void initGame(IntMatrix2 architecture,
		IntMatrix2 fruits, IntMatrix2 buildings,
		int limitCherry, int limitKiwi, int limitNut,
		int vitaminGoal, int maxNbTurns);

	void playTurn(IntMatrix2 newObjects,
		IntMatrix1 deletedObjects, IntMatrix2 movedFruits,
		IntMatrix2 modifiedFruits, IntMatrix2 modifiedSugarDrops);

	void mapUpdate(IntMatrix2 newObjects, IntMatrix2 modifiedSugarDrops);
};

extern Ai ai;

#endif
